<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>业务管理</title>
	<meta name="decorator" content="default"/>
	<style>
		.table-striped tbody>tr:nth-child(odd)>td, .table-striped tbody>tr:nth-child(odd)>th {
			background: none !important;
		}

	</style>
	<script type="text/javascript">
		$(document).ready(function() {
            $(".editsda").click(function () {
                var id =$(this).data("id");
                var name = $(this).data("name");
                var static = $(this).data("static");
                var csflag = $(this).data("ss");
                if (name == '1'){
					layer.open({
						type: 2,
						title:"回访信息录入",
						skin: 'layui-layer-rim', //加上边框
						offset: ['50px', '100px'],
						area: ['900px', '90%'], //宽高
						content: "${ctx}/sys/business/business/huifang?id="+id
					});
				}
                if(csflag == "1"){
                    layer.open({
                        title: '提示信息'
                        ,content: '已超时，不可编辑！！！',
                        time: 2000
                    });
                }
                else if (name == '2'){
                    layer.open({
                        type: 2,
                        title:"受理情况录入",
                        skin: 'layui-layer-rim', //加上边框
                        offset: ['50px', '100px'],
                        area: ['900px', '90%'], //宽高
                        content: "${ctx}/sys/business/business/shouli?id="+id
                    });
                }
                else if(name == '3'&& static =="复杂"){
                    layer.open({
                        type: 2,
                        title:"录入调查",
                        skin: 'layui-layer-rim', //加上边框
                        offset: ['50px', '100px'],
                        area: ['900px', '90%'], //宽高
                        content: "${ctx}/sys/business/business/diaocha?id="+id
                    });
                }
                else if(name == '4'){
                    layer.open({
                        type: 2,
                        title:"录入协调",
                        skin: 'layui-layer-rim', //加上边框
                        offset: ['50px', '100px'],
                        area: ['900px', '90%'], //宽高
                        content: "${ctx}/sys/business/business/xietiao?id="+id
                    });
                }
                else if(name == '5'){
                    layer.open({
                        type: 2,
                        title:"录入审批",
                        skin: 'layui-layer-rim', //加上边框
                        offset: ['50px', '100px'],
                        area: ['900px', '90%'], //宽高
                        content: "${ctx}/sys/business/business/shenpi?id="+id
                    });
                }
                else if((name == '3'&& static =="简易")|| name =='6'){
                    layer.open({
                        type: 2,
                        title:"录入结案",
                        skin: 'layui-layer-rim', //加上边框
                        offset: ['50px', '100px'],
                        area: ['900px', '90%'], //宽高
                        content: "${ctx}/sys/business/business/jiean?id="+id
                    });
                }
                else if(name == "7"){
                    layer.open({
                        title: '提示信息'
                        ,content: '已结案，不可编辑！！！',
                        time: 2000
                    });
                }

            })
            $("#result").click(function () {
                $('#memberName').val("");
                $('#kfName').val("");
                $('#jdTime').val("");
                $('#hfTime').val("");
                $('#dq').val("");
                $('#yjStatic').val("");
                $('#btnSubmit').click();
            })
            $(".ids").click(function () {
                var ids = $(this).data("id");
                layer.open({
                    type: 2,
                    title:"录入协调",
                    skin: 'layui-layer-rim', //加上边框
                    offset: ['50px', '100px'],
                    area: ['900px', '90%'], //宽高
                    content: "${ctx}/sys/business/business/xinxi?id="+ids
                });
            })
            $(".kfs").click(function () {
                var ids = $(this).data("id");
                layer.open({
                    type: 2,
                    title:"录入协调",
                    skin: 'layui-layer-rim', //加上边框
                    offset: ['50px', '100px'],
                    area: ['900px', '90%'], //宽高
                    content: "${ctx}/sys/business/business/kfTongji?kfId="+ids
                });
            })
            $(".emsd").click(function () {
                var id = $(this).data("id");
                var name = $(this).data("name");
                var static = $(this).data("static");
                var csflag = $(this).data("ss");
                alert(csflag);
            })
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/business/business/">业务列表</a></li>
		<%--<shiro:hasPermission name="sys:business:business:edit"><li><a href="${ctx}/sys/business/business/form">业务添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="business" action="${ctx}/sys/business/business/getYj" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>报案姓名：</label>
				<form:input path="memberName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>客服姓名：</label>
				<form:input path="kfName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>接单日期：</label>
				<input name="jdTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${business.jdTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li><label>回访日期：</label>
				<input name="hfTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${business.hfTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li><label>回访截止日期：</label>
				<input name="hffinalTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${business.hffinalTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li><label>状态码：</label>
				<form:select path="yjStatic" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('business_static')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
			             	<input id="result" class="btn btn-primary" type="submit" value="重置"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<shiro:hasPermission name="sys:business:business:edit"><th>操作</th></shiro:hasPermission>
				<th>报案姓名</th>
				<th>客服姓名</th>
				<th>接单日期</th>
				<th>回访日期</th>
				<%--<th>回访完成天数</th>--%>
				<th>回访截止日期</th>
                <th>受理日期</th>
                <th>案件难易</th>
				<th>预计调查截止日期</th>
				<th>预计协调截止日期</th>
				<th>预计审批截止日期</th>
                <%--<th>受理完成天数</th>--%>
                <th>预计结案日期</th>
				<th>状态</th>
				<%--<th>是否超时</th>--%>
				<th>结案日期</th>
				<th>备注信息</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="business">
			<%--<tr style="<c:choose>--%>
			    <%--<c:when test="${business.csFlag=='1'}">background:red !important;</c:when>--%>
				<%--<c:when test="${business.yjStatic=='1'}">background:#df7401 !important;</c:when>--%>
				<%--<c:when test="${business.yjStatic=='2'}">background:#dfb801 !important;</c:when>--%>
				<%--<c:when test="${business.yjStatic=='3'}">background:#2e71b5 !important;</c:when>--%>
				<%--<c:when test="${business.yjStatic=='4'}">background:#1ABC9C !important; </c:when>--%>
				<%--<c:when test="${business.yjStatic=='5'}">background:#46cfd1 !important;</c:when>--%>
				<%--<c:when test="${business.yjStatic=='6'}">background:#e44dff !important;</c:when>--%>
			    <%--<c:when test="${business.yjStatic=='7'}">background:#39ae00 !important;</c:when>--%>
				<%--<c:otherwise></c:otherwise>--%>
		   <%--</c:choose>">--%>
			<tr>
				<shiro:hasPermission name="sys:business:business:edit"><td>
					<a href="${ctx}/sys/business/business/form?id=${business.id}">修改</a>
						<%--<a href="javascript:void(0)" class="editsda" data-id=${business.id}, data-name= ${business.yjStatic}, data-static=${business.difficulty}, data-ss=${business.csFlag}>编辑</a>--%>
					<%--<a href="javascript:void(0)" class="editss" data-stic = ${business.yjStatic} data-id= ${business.id} >编辑</a>--%>
					<a href="${ctx}/sys/business/business/delete?id=${business.id}" onclick="return confirmx('确认要删除该业务吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
				<td><a href="#" class="ids" data-id=${business.id}>
					${business.memberName}
				</a></td>
				<td><a href="#" class="kfs" data-id=${business.kfId}>
					${business.kfName}
				</a></td>
				<td>
					<fmt:formatDate value="${business.jdTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${business.hfTime}" pattern="yyyy-MM-dd"/>
				</td>
				<%--<td>--%>
					<%--${business.huiDay}--%>
				<%--</td>--%>
				<td>
					<fmt:formatDate value="${business.hffinalTime}" pattern="yyyy-MM-dd"/>
				</td>
                <td>
                    <fmt:formatDate value="${business.slTime}" pattern="yyyy-MM-dd"/>
                </td>
                <td>
                        ${business.difficulty}
                </td>
				<td>
					<fmt:formatDate value="${business.dcFtime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${business.xtFtime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${business.spFtime}" pattern="yyyy-MM-dd"/>
				</td>
                <%--<td>--%>
                        <%--${business.slDay}--%>
                <%--</td>--%>
                <td>
                     <fmt:formatDate value="${business.finaTime}" pattern="yyyy-MM-dd"/>
                </td>
                <td>
                        ${fns:getDictLabel(business.yjStatic, 'business_static', '')}
                </td>
				<%--<td>--%>
						<%--${fns:getDictLabel(business.csFlag, 'cs_flag', '')}--%>
				<%--</td>--%>
				<td>
					<fmt:formatDate value="${business.jieTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${business.remarks}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>